import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Home',
      component: () => import('../views/home')
    }, {
      path: '*', // 404
      name: '404Page',
      redirect: '/'
    }, {
      path: '/menu',
      name: 'Menus',
      component: () => import('@/views/main/menu')
    }, {
      path: '/menu/:menuId',
      name: 'MenuDetail',
      component: () => import('@/views/main/menu/detail')
    }, {
      path: '/cart',
      name: 'Cart',
      component: () => import('@/views/main/cart/cart')
    }, {
      path: '/recommend',
      name: 'MenuRecommend',
      component: () => import('@/views/main/menu/recommend')
    }, {
      path: '/recommend/:menuId',
      name: 'MenuRecommendDetail',
      component: () => import('@/views/main/menu/recommend-detail')
    }
  ]
})
